package com.hspedu.homework01;

public class Homework04 {
    public static void main(String[] args) {
        String str = "HomeWork04";
        System.out.println(countUpp(str));
    }

    public static String countUpp(String str){
        int count = 0;
        int count1 = 0;
        if(str == null){
            return "error";
        }

        for (int i = 0; i < str.length(); i++) {
            if(Character.isUpperCase(str.charAt(i))){
                count++;
            }
            if(Character.isLowerCase(str.charAt(i))){
                count1++;
            }
        }
        return "number of upper words is " + count + " number of lower words is " + count1;
    }
}
